// 导入 创建路由对象需要使用的函数
import { createRouter,createWebHashHistory} from 'vue-router'
import Register from '../views/Register.vue'
import ForgotPassword from '../views/ForgotPassword.vue'
import Layout1 from '../views/ordinaryUser/Layout.vue'
import Layout2 from '../views/advancedUser/Layout.vue'
import Layout3 from '../views/administrator/Layout.vue'
import Login from '../views/Login.vue'



//创建一个路由对象
const router = createRouter({
    //history属性用于记录路由的历史
    history: createWebHashHistory(),
    //用于定义多个不同的路径和组件之间的对应关系
    routes: [
        {
            path:"/register",
            component: Register
        },
        {
            path:"/login",
            component: Login
        },
        {
            path:"/forgotPassword",
            component: ForgotPassword
        },
        {
            path:"/ordinaryUser/layout",
            component: Layout1
        },
        {
            path:"/advancedUser/layout",
            component: Layout2
        },
        {
            path:"/administrator/layout",
            component: Layout3
        },
        {
            path:"/",
            component: Login
        }
    ]
})


//向外暴露 Router
export default router